package profiterole.api;

import java.io.Serializable;
import java.util.List;
import java.util.Map.Entry;

public interface Waffle<T extends Comparable<? super T>> extends Serializable{
	
	public T get(String key);
		
	public boolean containsKey(String key);
	
	public boolean containsValue(String value);
	
	public long getTimeStamp();
	
	public List<Entry<String, T>> getSortedUnModifiableList();
	
	//Java can't put static modifier in interface
	public Waffle<T> update(String folder, ReduceStrategy<T> strategy);
	
	public Waffle<T> update(Waffle<T> other, ReduceStrategy<T> strategy);
	
	// TODO synchronization policy can be one or many objects
	interface ReduceStrategy<T> {
		T apply(T arg1, T arg2);
	}
}